The IDocumentExtension3 extension classes-type may also be used in the context of executing dynamic tables. You just have to branch off the BaseResourceExtension class. The extension class must be defined in the administration of the form corresponding to the table row edition.
The full name is: com.axemble.vdoc.sdk.document.extensions.BaseResourceExtension.
Methods of the BaseResourceExtension class
public abstract class BaseResourceExtension implements IDocumentExtension3 { // helper methods public IResourceController getResourceController(); public ILinkedResource getLinkedResource(); public IWorkflowModule getWorkflowModule(); // load public boolean onBeforeLoad() public boolean onAfterLoad() // subscription public boolean isOnChangeSubscriptionOn( IProperty property ) public void onPropertyChanged( IProperty property ) // close public boolean onBeforeClose() }
Example of document extension implementation
As the following example shown, the class remains very simple because you do not need to implement all the IDocumentExtension3 interface method. Moreover, some methods have been translated in the API SDK objects.
The following example shows how, on a resource field modification (table row), to modify the value of the parent field.
public class ChildExtension extends BaseResourceExtension { private static final long serialVersionUID = 93867211817252323L; public void onPropertyChanged( IProperty property ) { // get the new value back Object newValue = this.getLinkedResource().getValue( property.getName() ); // position a parent field with the new value get back. this.getLinkedResource().getParentInstance().setValue( "parentProperty", newValue ); super.onPropertyChanged( property ); } }